import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import Axios from 'axios';
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.snow.css'


Vue.config.productionTip = false
// Axios.defaults.baseURL = "/api"
Axios.defaults.baseURL = 'http://47.52.210.190:8081'
// Axios.defaults.withCredentials = true;
// 添加请求拦截器，在请求头中加token
Axios.interceptors.request.use(
  config => {
    config.headers['Access-Control-Max-Age'] = 86400
    if (localStorage.getItem('Authorization')) {
      config.headers.Authorization = localStorage.getItem('Authorization');
    }
 
    return config;
  },
  error => {
    return Promise.reject(error);
  });
  
Vue.prototype.$axios = Axios;
Vue.use(ViewUI)
Vue.use(VueQuillEditor);

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
